<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>标题</title>
<meta name="Keywords" content="">
<meta name="Description" content="">
<link rel='stylesheet' href='../css/fyz.public.style.css' />
<script type='text/javascript' src='../js/jquery-1.8.3.min.js'></script>
</head>
<body style='height:2000px;'>
<style type="text/css">
div.clickBackTop{width:120px; height:100px; line-height:100px; position:fixed; bottom:20px; right:0px; z-index:200; background:orange; cursor:pointer;}
</style>
<div class='clickBackTop'></div>
<script type="text/javascript">
(function($){
    $.fn.extend({
        'clickBackTop':function(options){
			var opts = $.extend({},clickBackTop_Defaluts,options);
			var $this = $(this);
			$(window).scroll(function(){
				opts.scrollTop = document.body.scrollTop||document.documentElement.scrollTop;
				$this.live('click',function(){
					clearInterval(opts.timer);
					opts.timer = setInterval(function(){
						opts.scrollTop = opts.scrollTop - opts.Dstance;
						if(opts.scrollTop <= 0){clearInterval(opts.timer);};
						if(document.body.scrollTop){
							document.body.scrollTop = opts.scrollTop;
						}else if(document.documentElement.scrollTop){
							document.documentElement.scrollTop = opts.scrollTop;
						};
					},opts.setIntervalTime);
				});
			});
		}
    });
	var clickBackTop_Defaluts = {
		scrollTop:'',
		Dstance:30,
		setIntervalTime:20,		
		timer:null,
	};
}(window.jQuery));
</script>
<script type="text/javascript">
$('div.clickBackTop').clickBackTop({
    Dstance:30,//距离
    setIntervalTime:20,//时间        
});
</script>
</body>
</html>